<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script>
        var user={
            name:"王文胜",
            age:"20",
            sex:"男"
        }
        var json = JSON.stringify(user);
        console.log(json);
        var user = JSON.parse(json);
        console.log(user);

    </script>
</head>
<body>

</body>
</html>